Open Traffic Generator API (1.46.0)

Download OpenAPI specification:Download

Open Traffic Generator API defines a model-driven, vendor-neutral and standard interface for emulating layer 2-7 network devices and generating test traffic.

Contributions can be made in the following ways:

Configuration

set_config

Sets configuration resources on the traffic generator.

Request Body schema: application/json
Array of objects (Port)

The ports that will be configured on the traffic generator.

Array of objects (Lag)

The LAGs that will be configured on the traffic generator.

Array of objects (Layer1)

The layer1 settings that will be configured on the traffic generator. Since layer1 settings usually vary across variety of test ports, these most likely won't be portable.

Array of objects (Capture)

The capture settings that will be configured on the traffic generator.

Array of objects (Device)

The emulated devices that will be configured on the traffic generator. Each device contains configurations for network interfaces and protocols running on top of those interfaces.

Array of objects (Flow)

The flows that will be configured on the traffic generator.

object (Event)

The optional container for event configuration. Both cp_events.enable and dp_events.enable must be explicitly set to true to get control_plane_data_plane_convergence_us metric values for convergence metrics.

object (Config.Options)

Global configuration options.

Array of objects (Lldp)

LLDP protocol that will be configured on traffic generator.

object (StatefulFlow)

Conversational traffic where the responding side can be responded back with control messages, eg incase of rocev2 responding side can send ack, nak.

Array of objects (EgressOnlyTracking)

Container for specification of desired tracking, based on certain offset and length of bits for received packets on specified receive ports. It enables the user to retrieve information based on number of unique packets received for each unique value in the bits being tracked from the beginning of the test.

Responses

Request samples

Content type
application/json
{
  • "ports": [
    ],
  • "lags": [
    ],
  • "layer1": [
    ],
  • "captures": [
    ],
  • "devices": [
    ],
  • "flows": [
    ],
  • "events": {
    },
  • "options": {
    },
  • "lldp": [
    ],
  • "stateful_flows": {
    },
  • "egress_only_tracking": [
    ]
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

get_config

Responses

Response samples

Content type
application/json
{
  • "ports": [
    ],
  • "lags": [
    ],
  • "layer1": [
    ],
  • "captures": [
    ],
  • "devices": [
    ],
  • "flows": [
    ],
  • "events": {
    },
  • "options": {
    },
  • "lldp": [
    ],
  • "stateful_flows": {
    },
  • "egress_only_tracking": [
    ]
}

update_config

Updates specific attributes of resources configured on the traffic generator. The fetched configuration shall reflect the updates applied successfully. The Response.Warnings in the Success response is available for implementers to disclose additional information about a state change including any implicit changes that are outside the scope of the state change.

Request Body schema: application/json
choice
string
Value: "flows"
object (Flows.Update)

A container of flows with associated properties to be updated without affecting the flows current transmit state.

Responses

Request samples

Content type
application/json
{
  • "choice": "flows",
  • "flows": {
    }
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

append_config

Append new attributes of resources to existing configuration on the traffic generator. Resource names should not be part of existing configuration of that resource type; it should be unique for the operation to succeed. A failed append might leave the configuration in an undefined state and if the error is due to some invalid or unsupported configuration in the appended resources, it is expected that the user fix the error and restart from SetConfig operation. The fetched configuration shall also reflect the new configuration applied successfully.

Request Body schema: application/json
Array ()
choice
required
string
Value: "flows"
Array of objects (Flow)

The flows that will be added to existing configuration on the traffic generator. The flow name must not already be used in existing configuration.

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

delete_config

Delete attributes of resources from existing configuration on the traffic generator. Resource names should already be part of existing configuration of that resource type; for the operation to succeed. A failed delete will leave the configuration in an undefined state and if the error is due to some invalid or unsupported configuration in the deleted resources, it is expected that the user fix the error and restart from SetConfig operation. On successful deletion the fetched configuration shall not reflect the removed configuration.

Request Body schema: application/json
Array ()
choice
required
string
Value: "flows"
flows
Array of strings

List of flows that will be deleted from existing configuration on the traffic generator.

x-constraint:

  • /components/schemas/Flow/properties/name

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

Control

set_control_state

Sets the operational state of configured resources.

Request Body schema: application/json
choice
required
string
Enum: "port" "protocol" "traffic"
object (State.Port)

States associated with configured ports.

object (State.Protocol)

States associated with protocols on configured resources.

object (State.Traffic)

States associated with configured flows

Responses

Request samples

Content type
application/json
{
  • "choice": "port",
  • "port": {
    },
  • "protocol": {
    },
  • "traffic": {
    }
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

set_control_action

Triggers actions against configured resources.

Request Body schema: application/json
choice
required
string
Enum: "protocol" "port"
object (Action.Protocol)

Actions associated with protocols on configured resources.

object (Action.Port)

Actions associated with ports on configured resources.

Responses

Request samples

Content type
application/json
{
  • "choice": "protocol",
  • "protocol": {
    },
  • "port": {
    }
}

Response samples

Content type
application/json
{
  • "warnings": [
    ],
  • "response": {
    }
}

Monitor

get_metrics

Request Body schema: application/json

Request to traffic generator for metrics of choice

choice
string
Default: "port"
Enum: "port" "flow" "bgpv4" "bgpv6" "isis" "lag" "lacp" "lldp" "rsvp" "dhcpv4_client" "dhcpv4_server" "dhcpv6_client" "dhcpv6_server" "ospfv2" "convergence" "macsec" "mka" "ospfv3" "rocev2_ipv4" "rocev2_ipv6" "rocev2_flow" "egress_only_tracking" "bmp_server"
object (Port.Metrics.Request)

The port result request to the traffic generator

object (Flow.Metrics.Request)

The container for a flow metric request.

object (Bgpv4.Metrics.Request)

The request to retrieve BGPv4 per peer metrics/statistics.

object (Bgpv6.Metrics.Request)

The request to retrieve BGPv6 per peer metrics/statistics.

object (Isis.Metrics.Request)

The request to retrieve ISIS per Router metrics/statistics.

object (Lag.Metrics.Request)

The request to retrieve per LAG metrics/statistics.

object (Lacp.Metrics.Request)

The request to retrieve LACP per LAG member metrics/statistics.

object (Lldp.Metrics.Request)

The request to retrieve LLDP per instance metrics/statistics.

object (Rsvp.Metrics.Request)

The request to retrieve RSVP-TE per Router metrics/statistics.

object (Dhcpv4Client.Metrics.Request)

The request to retrieve DHCPv4 per client metrics/statistics.

object (Dhcpv4Server.Metrics.Request)

The request to retrieve DHCPv4 per Server metrics/statistics.

object (Dhcpv6Client.Metrics.Request)

The request to retrieve DHCPv6 per client metrics/statistics.

object (Dhcpv6Server.Metrics.Request)

The request to retrieve DHCPv6 per Server metrics/statistics.

object (Ospfv2.Metrics.Request)

The request to retrieve OSPFv2 per Router metrics/statistics.

object (Convergence.Request)

Container for requesting control-plane and data-plane convergence time metrics for flows.

object (Macsec.Metrics.Request)

The request to retrieve MACsec per secure entity(secY) metrics/statistics.

object (Mka.Metrics.Request)

The request to retrieve MKA per peer metrics/statistics.

object (Ospfv3.Metrics.Request)

The request to retrieve OSPFv3 per router metrics/statistics.

object (Rocev2IPv4.Metrics.Request)

Request to retrieve RoCEv2 over IPv4 per peer metrics/statistics.

object (Rocev2IPv6.Metrics.Request)

Request to retrieve RoCEv2 over IPv6 per peer metrics/statistics.

object (Rocev2Flow.Metrics.Request)

Request to retrieve RoCEv2 FLow statistics.

object (EgressOnlyTracking.Metrics.Request)

The container for a egress only tracking metric request.

object (BmpServer.Metrics.Request)

The request to retrieve per BMP Server metrics/statistics.

Responses

Request samples

Content type
application/json
{
  • "choice": "port",
  • "port": {
    },
  • "flow": {
    },
  • "bgpv4": {
    },
  • "bgpv6": {
    },
  • "isis": {
    },
  • "lag": {
    },
  • "lacp": {
    },
  • "lldp": {
    },
  • "rsvp": {
    },
  • "dhcpv4_client": {
    },
  • "dhcpv4_server": {
    },
  • "dhcpv6_client": {
    },
  • "dhcpv6_server": {
    },
  • "ospfv2": {
    },
  • "convergence": {
    },
  • "macsec": {
    },
  • "mka": {
    },
  • "ospfv3": {
    },
  • "rocev2_ipv4": {
    },
  • "rocev2_ipv6": {
    },
  • "rocev2_flow": {
    },
  • "egress_only_tracking": {
    },
  • "bmp_server": {
    }
}

Response samples

Content type
application/json
{
  • "choice": "port_metrics",
  • "port_metrics": [
    ],
  • "flow_metrics": [
    ],
  • "bgpv4_metrics": [
    ],
  • "bgpv6_metrics": [
    ],
  • "isis_metrics": [
    ],
  • "lag_metrics": [
    ],
  • "lacp_metrics": [
    ],
  • "lldp_metrics": [
    ],
  • "rsvp_metrics": [
    ],
  • "dhcpv4client_metrics": [
    ],
  • "dhcpv4server_metrics": [
    ],
  • "dhcpv6client_metrics": [
    ],
  • "dhcpv6server_metrics": [
    ],
  • "ospfv2_metrics": [
    ],
  • "convergence_metrics": [
    ],
  • "macsec_metrics": [
    ],
  • "mka_metrics": [
    ],
  • "ospfv3_metrics": [
    ],
  • "rocev2_ipv4_per_peer_metrics": [
    ],
  • "rocev2_ipv6_per_peer_metrics": [
    ],
  • "rocev2_flow_per_qp_metrics": [
    ],
  • "egress_only_tracking_metrics": [
    ],
  • "bmp_server_metrics": [
    ]
}

get_states

Request Body schema: application/json

Request to traffic generator for states of choice

choice
string
Default: "ipv4_neighbors"
Enum: "ipv4_neighbors" "ipv6_neighbors" "bgp_prefixes" "isis_lsps" "lldp_neighbors" "rsvp_lsps" "dhcpv4_interfaces" "dhcpv4_leases" "dhcpv6_interfaces" "dhcpv6_leases" "ospfv2_lsas" "ospfv3_lsas" "isis_adjacencies" "bmp_servers"
object (Neighborsv4.States.Request)

The request to retrieve IPv4 Neighbor state (ARP cache entries) of a network interface(s).

object (Neighborsv6.States.Request)

The request to retrieve IPv6 Neighbor state (NDISC cache entries) of a network interface(s).

object (BgpPrefix.State.Request)

The request to retrieve BGP peer prefix information.

object (IsisLsps.State.Request)

The request to retrieve ISIS Link State PDU (LSP) information learned by the router.

object (LldpNeighbors.State.Request)

The request to retrieve LLDP neighbor information for a given instance.

object (RsvpLsps.State.Request)

The request to retrieve RSVP Label Switched Path (LSP) information learned by the router.

object (Dhcpv4Interface.State.Request)

The request for assigned IPv4 address information associated with DHCP Client sessions.

object (Dhcpv4Lease.State.Request)

The request to retrieve DHCP Server host allocated status.

object (Dhcpv6Interface.State.Request)

The request for assigned IPv6 address information associated with DHCP Client sessions.

object (Dhcpv6Lease.State.Request)

The request to retrieve DHCP Server host allocated status.

object (Ospfv2Lsas.State.Request)

The request to retrieve OSPFv2 Link State Advertisements (LSA) information learned by the routers.

object (Ospfv3Lsas.State.Request)

The request to retrieve OSPFv3 Link State Advertisements (LSA) information learned by the routers.

object (IsisIIHs.State.Request)

The request to retrieve ISIS IIH information exchanged by the ISIS routers.

object (BmpServers.State.Request)

The request for BMP server information.

Responses

Request samples

Content type
application/json
{
  • "choice": "ipv4_neighbors",
  • "ipv4_neighbors": {
    },
  • "ipv6_neighbors": {
    },
  • "bgp_prefixes": {
    },
  • "isis_lsps": {
    },
  • "lldp_neighbors": {
    },
  • "rsvp_lsps": {
    },
  • "dhcpv4_interfaces": {
    },
  • "dhcpv4_leases": {
    },
  • "dhcpv6_interfaces": {
    },
  • "dhcpv6_leases": {
    },
  • "ospfv2_lsas": {
    },
  • "ospfv3_lsas": {
    },
  • "isis_adjacencies": {
    },
  • "bmp_servers": {
    }
}

Response samples

Content type
application/json
{
  • "choice": "ipv4_neighbors",
  • "ipv4_neighbors": [
    ],
  • "ipv6_neighbors": [
    ],
  • "bgp_prefixes": [
    ],
  • "isis_lsps": [
    ],
  • "lldp_neighbors": [
    ],
  • "rsvp_lsps": [
    ],
  • "dhcpv4_interfaces": [
    ],
  • "dhcpv4_leases": [
    ],
  • "dhcpv6_interfaces": [
    ],
  • "dhcpv6_leases": [
    ],
  • "ospfv2_lsas": [
    ],
  • "ospfv3_lsas": [
    ],
  • "isis_adjacencies": [
    ],
  • "bmp_servers": [
    ]
}

get_capture

Request Body schema: application/json

Capture results request to the traffic generator.

port_name
required
string

The name of a port a capture is started on.

x-constraint:

  • /components/schemas/Port/properties/name
object (CaptureRequest.Packets)

Packets to be returned in the capture result from the set of captured packets as per capture configuration.

Responses

Request samples

Content type
application/json
{
  • "port_name": "string",
  • "packets": {
    }
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "kind": "validation",
  • "errors": [
    ]
}

Capabilities

get_version

Responses

Response samples

Content type
application/json
{
  • "api_spec_version": "",
  • "sdk_version": "",
  • "app_version": ""
}